import {createRouter, createWebHistory} from 'vue-router'
// import PMSWelcome from './components/auth/Welcome'
import PMSLogin from './components/auth/Login'
import PMSRegister from './components/auth/Register'
import PMSDashBoard from './components/Dashboard'

const router = createRouter({
    history: createWebHistory(),
    routes: [
        {
            path: "/",
            // component: PMSWelcome
            redirect: "/home/default"
        },
        {
            path: '/login',
            component: PMSLogin
        },
        {
            path: '/register',
            component: PMSRegister
        },
        {
            path: '/home/:username',
            component: PMSDashBoard
        }
    ],
})

const ReLogin = () => {
    router.replace('/login')
}

export {router, ReLogin};